---------------------------------------------------------------
File name   :  vv_ahblite__h.e
Title       :   unit declaration
Project     :  vv_ahblite eVC
Developers  :  stefan,filip
Created     :  26.07.2011.
Description :  This file declares the ironment unit.
Notes       :  
---------------------------------------------------------------
Copyright  (c)2011
---------------------------------------------------------------

<'
package vv_ahblite;

-- ==========================================================================
-- This unit is the top level of the eVC. There should be one instance
-- of this unit for each vv_ahblite bus in the DUT.
-- ==========================================================================
extend vv_ahblite_env {
	
	
	
	
    -- The messaging feature is a centralized and flexible mechanism to print
    -- useful text messages to the screen or to log files. It lets the code 
    -- developer easily insert formatted and colored messages into the code.
    -- It provides the end user with powerful and flexible controls to 
    -- selectively enable or disable groups of messages.
    -- This field provides a screen logger for each eVC instance. By default,
    -- its verbosity is set to NONE (disabled).
    logger      : message_logger is instance;
        keep soft logger.verbosity == NONE;
    
    file_logger: message_logger is instance; 
        keep soft file_logger.verbosity == HIGH; 
        keep soft file_logger.tags == {NORMAL}; 
        keep soft file_logger.to_file == "vv_ahblite.elog"; 
        keep soft file_logger.to_screen == FALSE; 
    
    -- This field holds the logical name of this . This field must be
    -- constrained by the user in the config file.
    name        : vv_ahblite_env_name_t;
    
    -- Signal map instance
    smp         : vv_ahblite_smp is instance;
        keep smp.env_name == read_only(name); --generate smp._name only after the "name" has already been generated
   
    -- System smp instance
    sys_smp     : vv_ahblite_system_smp is instance;
        keep sys_smp.env_name == read_only(name);
    
    -- Slave memory address map
    addr_map : vr_ad_map;
    
    
    
    -- Bus monitor instance
    bus_monitor : vv_ahblite_bus_monitor is instance;
        keep bus_monitor.p_env             == me;
        keep bus_monitor.p_smp             == read_only(smp);
        keep bus_monitor.env_name          == name;
        keep soft bus_monitor.has_checks   == read_only(has_checks);
        keep soft bus_monitor.has_coverage == read_only(has_coverage);
        keep soft bus_monitor.p_sys_smp    == read_only(sys_smp);
    
    -- master instance. By default, the master is
    -- constrained to be active, but you can override that in the config
    -- file.
    master : vv_ahblite_master is instance;
        keep soft master.active_passive == ACTIVE;
        keep master.p_env               == read_only(me);
        keep master.env_name            == read_only(name);
        keep master.p_smp               == read_only(smp);
        keep soft master.p_sys_smp      == read_only(sys_smp); 
    
    -- This field holds a list of the logical names of all active
    -- slaves contained by the .
    -- This field must be constrained in the config file to create any
    -- required active slaves. The field active_slaves 
    -- is automatically constrained according to the content of this field.
    active_slave_names     : list of vv_ahblite_agent_name_t;
        keep soft active_slave_names.size() == 0;

    -- This field holds a list of the logical names of all passive
    -- slaves contained by the .
    -- This field must be constrained in the config file to create any
    -- required passive slaves.
    -- The field passive_slaves is automatically constrained
    -- according to the content of this field.
    passive_slave_names    : list of vv_ahblite_agent_name_t;
        keep soft passive_slave_names.size() == 0;

    -- This field contains a list of all the active slave agents
    -- in the . The field must not be constrained. Instead, constrain the
    -- field active_slave_names in the config file.
    active_slaves          : list of ACTIVE vv_ahblite_slave is instance;
        keep active_slaves.size() == read_only(active_slave_names.size());
        keep for each (slave) in active_slaves {
            slave.name           == read_only(active_slave_names[index]);
            slave.p_env          == read_only(me);
            slave.env_name       == read_only(name);
            slave.p_bus_monitor  == read_only(bus_monitor);
            slave.p_smp          == read_only(smp);
            soft slave.p_sys_smp == read_only(sys_smp); 
    };

    -- This field contains a list of all the passive slave agents
    -- in the .
    -- The field must not be constrained. Instead, constrain the field
    -- passive_slave_names in the config file
    passive_slaves         : list of PASSIVE vv_ahblite_slave is instance;
        keep passive_slaves.size() == read_only(passive_slave_names.size());
        keep for each (slave) in passive_slaves {
            slave.name           == read_only(passive_slave_names[index]);
            slave.p_env          == read_only(me);
            slave.env_name       == read_only(name);
            slave.p_bus_monitor  == read_only(bus_monitor);
            slave.p_smp          == read_only(smp);
            soft slave.p_sys_smp == read_only(sys_smp);
    };
   
    -- This field contains a list of all the slaves (both active
    -- and passive) in the .
    slaves    : list of vv_ahblite_slave;
        keep slaves == read_only({passive_slaves; active_slaves});
   
    -- By default, protocol checking is disabled. This field can be used to
    -- enable protocol checking by setting the field to TRUE and constraining
    -- other has_checks flags to this field.
    has_checks : bool;
       keep soft has_checks == FALSE;
    
    -- By default, coverage collection is disabled. This field can be used to
    -- enable coverage collection by setting the field to TRUE and
    -- constraining other has_coverage flags to this field.
    has_coverage : bool;
       keep soft has_coverage == FALSE;
   
    -- Color used in messages for this unit
    env_vt_style: vt_style;
       keep soft env_vt_style == DARK_RED;
    
    -- Unit name used in messages
    env_message_name : string;
       keep soft env_message_name == append("vv_ahblite_env",name.as_a(string));
   
    -- This method is called after post_generate() to create unit
    -- references between sibling units.
    connect_pointers() is also { 
        master.p_bus_monitor = bus_monitor;
        for each (slave) in active_slaves {
            slave.p_bus_monitor = bus_monitor;
        };
        for each (slave) in passive_slaves {
            slave.p_bus_monitor = bus_monitor;
        };     
    }; 
    
    -- The short_name() method returns the name of this UVC instance.
    short_name(): string is {
        result = env_message_name;
    };
    
    -- This method controls the color of the short name.
    short_name_style(): vt_style is {
       result = env_vt_style;
    };
    
    
    
}; 


'>
